﻿using Cl.Model.DataBaseEntityDtos.Goods.BaseGoods;
using Cl.Utils.Helper.AutoMap;
using Cl.Utils.Primitives.Const.Goods;
using Elsa.Activities.StateMachine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cl.Model.DataBaseEntityDtos.Orders.GoodsOrders
{
    public class GoodsOrderOutputDto
    {

        public GoodsOrderOutputDto() { }

        public GoodsOrderOutputDto(Entity.DataBaseEntity.Orders.GoodsOrder info)
        {
            //自动映射到当前对象
            AutoMapHelper.MapTo(info, this);

            if (info.OrderRelatedGoodsList != null)
            {
                GoodsList = info.OrderRelatedGoodsList.Select(s => new BaseGoodsOutputDto(s.BaseGoodsData) { }).ToList();
            }
        }

        public List<BaseGoodsOutputDto> GoodsList { get; set; } = new List<BaseGoodsOutputDto>();
        public DateTime ExpirationData { get; set; }

        public DateTime CreateTime { get; set; }

        public int Id { get; set; }
        public string OrderCode { get; set; }

        /// <summary>
        /// 类似商品的名称组合之类的
        /// </summary>
        public string OrderName { get; set; }

        public int ShopId { get; set; }

        public string ShopName { get; set; }


        public string Community { get; set; }

        public string Avatar { get; set; }

        public decimal Total { get; set; }

        /// <summary>
        /// 订单状态 [1已取消，2待支付，3待收货，4待评价，5完成，6退款中，7退款完成]
        /// </summary>
        public int Status { get; set; }
    }
}
